package com.woniu.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.woniu.pojo.China;
import com.woniu.service.ChinaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/china")
@Api(tags = "地址管理")
public class ChinaController {
    @Autowired
    private ChinaService chinaService;

    /**
     * 获取所有省份
     * */
//    @GetMapping("/getAllProvince")
//    @ApiOperation("获取所有省份")
//    public ResponseEntity<List<China>> getAllProvinces(){
//        LambdaQueryWrapper<China> wrapper = new LambdaQueryWrapper<China>()
//                .eq(China::getPid, 0)
//                .ne(China::getId, 0)    // 该方法作用 ： 排除id为0的数据。 查询结果存在中国，需要将其排除
//                .orderByAsc(China::getId);
//        List<China> chinaList = chinaService.list(wrapper);
//
//        return ResponseEntity.ok(chinaList);
//    }



}
